import baseService from "@/service/baseService";
import { IObject } from "@/types/interface";
import { ElMessage } from "element-plus";
/**
 * 获取服务列表
 * @returns 服务列表
 */
const getServiceList = async () => {
  return await baseService.get("/noc/texhservice/list").then((res) => {
    if (res.code !== 0) {
      return ElMessage.error(res.msg);
    } else {
      return res.data;
    }
  });
};
/**
 * 保存展会服务项
 * @param serviceRel 展会服务项
 * @returns 是否保存成功
 */
const saveServiceRel = async (serviceRel: IObject<any> | undefined) => {
  return await baseService.post("/noc/texhservicerel", serviceRel).then((res) => {
    if (res.code !== 0) {
      return ElMessage.error(res.msg);
    } else {
      return true;
    }
  });
};
export { getServiceList, saveServiceRel };
